
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8"></meta>
      <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
      <title>12.1.&nbsp;Path Expander - Chapter&nbsp;12.&nbsp;Path Finding</title>
      <link rel="stylesheet" type="text/css" href="../../docbook.css"></link>
      <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600,300italic"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/theme/neo.min.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/chunked-base.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/extra.css"></link><script src="//code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script><script src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" type="text/javascript"></script><script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/addon/runmode/runmode.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/mode/cypher/cypher.min.js" type="text/javascript"></script><script src="../../javascript/datatable.js" type="text/javascript"></script><script src="../../javascript/colorize.js" type="text/javascript"></script><script src="../../javascript/tabs-for-chunked.js" type="text/javascript"></script><script src="../../javascript/mp-nav.js" type="text/javascript"></script><script src="../../javascript/versionswitcher.js" type="text/javascript"></script><script src="../../javascript/version.js" type="text/javascript"></script><script src="//s3-eu-west-1.amazonaws.com/alpha.neohq.net/docs/new-manual/assets/search.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></meta>
      <link rel="prev" href="../" title="Chapter&nbsp;12.&nbsp;Path Finding"></link>
      <link rel="next" href="../neighbourhood-search/" title="12.4.&nbsp;Neighbor Functions"></link>
      <link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico"></link><script>
        $(document).ready(function() {
          CodeMirror.colorize();
          tabTheSource($('body'));
          var $header = $('header').first();
          $header.prepend(
            $('<a href="" id="logo"><img src="https://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015.png" alt="Neo4j Logo"></img></a>')
          );
          var $sidebar = $('<div id="sidebar-wrapper"></div>');
          $.get('toc.html', function (d){
            $(d).appendTo($sidebar);
            highlightToc();
            highlightLibraryHeader();
          });
          $sidebar.insertAfter($('header').first());
        });
        </script></head>
   <body>
      <header>
         <div class="searchbox">
            <form id="search-form" class="search" name="search-form" role="search"><input id="search-form-input" name="q" title="search" type="search" lang="en" placeholder="Search Neo4j docs..." aria-label="Search Neo4j documentation" max-length="128" required="required"></input><input id="search-form-button" type="submit" value="Search"></input></form>
         </div>
         <ul class="documentation-library">
            <li><a href="https://neo4j.com/docs/operations-manual/current">Operations Manual</a></li>
            <li><a href="https://neo4j.com/docs/developer-manual/current/">Developer Manual</a></li>
            <li><a href="https://neo4j.com/docs/ogm-manual/current/">OGM Manual</a></li>
            <li><a href="https://neo4j.com/docs/graph-algorithms/current/">Graph Algorithms</a></li>
            <li><a href="https://neo4j-contrib.github.io/neo4j-apoc-procedures/3.4/">APOC</a></li>
            <li><a href="https://neo4j.com/docs/java-reference/current/">Java Reference</a></li>
         </ul>
         <nav id="header-nav"><span class="nav-previous"><a accesskey="p" href="../"><span class="fa fa-long-arrow-left" aria-hidden="true"></span>Path Finding</a></span><span class="nav-current">
               <p class="nav-title hidden">12.1.&nbsp;Path Expander</p></span><span class="nav-next"><a accesskey="n" href="../neighbourhood-search/">Neighbor Functions<span class="fa fa-long-arrow-right" aria-hidden="true"></span></a></span></nav>
      </header>
      <div id="search-results" class="hidden"></div>
      <section class="section" id="path-expander">
         <div class="titlepage">
            <div>
               <div>
                  <h2 class="title" style="clear: both"><a class="anchor" href="#path-expander"></a>12.1.&nbsp;Path Expander
                  </h2>
               </div>
            </div>
         </div>
         <p>Thanks to Andrew Bowman (@inversefalcon) and Kees Vegter (@keesvegter)</p>
         <p>The apoc.path.expand procedure makes it possible to do variable length path traversals where you can specify the direction
            of the relationship per relationship type and a list of Label names which act as a "whitelist" or a "blacklist" or define
            end nodes for the expansion. The procedure will return a list of Paths in a variable name called "path".
         </p>
         <div class="informaltable">
            <div class="table" id="d0e14407">
               <table class="informaltable" border="1">
                  <colgroup>
                     <col class="col_1"></col>
                     <col class="col_2"></col>
                  </colgroup>
                  <tbody>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">call apoc.path.expand(startNode &lt;id&gt;|Node, relationshipFilter, labelFilter, minDepth, maxDepth ) yield path as &lt;identifier&gt;</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>expand from given nodes(s) taking the provided restrictions into account</p>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </div>
         </div>
         <p>Variations allow more configurable expansions, and expansions for more specific use cases:</p>
         <div class="informaltable">
            <div class="table" id="d0e14422">
               <table class="informaltable" border="1">
                  <colgroup>
                     <col class="col_1"></col>
                     <col class="col_2"></col>
                  </colgroup>
                  <tbody>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">call apoc.path.expandConfig(startNode &lt;id&gt;Node/list, {minLevel, maxLevel, relationshipFilter, labelFilter, bfs:true, uniqueness:'RELATIONSHIP_PATH',
                                 filterStartNode:true, limit, optional:false, endNodes, terminatorNodes, sequence, beginSequenceAtStart:true}) yield path</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>expand from given nodes(s) taking the provided restrictions into account</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">call apoc.path.subgraphNodes(startNode &lt;id&gt;Node/list, {maxLevel, relationshipFilter, labelFilter, bfs:true, filterStartNode:true,
                                 limit, optional:false, endNodes, terminatorNodes, sequence, beginSequenceAtStart:true}) yield node</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>expand a subgraph from given nodes(s) taking the provided restrictions into account; returns all nodes in the subgraph</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">call apoc.path.subgraphAll(startNode &lt;id&gt;Node/list, {maxLevel, relationshipFilter, labelFilter, bfs:true, filterStartNode:true,
                                 limit, endNodes, terminatorNodes, sequence, beginSequenceAtStart:true}) yield nodes, relationships</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>expand a subgraph from given nodes(s) taking the provided restrictions into account; returns the collection of subgraph nodes,
                              and the collection of all relationships within the subgraph
                           </p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">call apoc.path.spanningTree(startNode &lt;id&gt;Node/list, {maxLevel, relationshipFilter, labelFilter, bfs:true, filterStartNode:true,
                                 limit, optional:false, endNodes, terminatorNodes, sequence, beginSequenceAtStart:true}) yield path</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>expand a spanning tree from given nodes(s) taking the provided restrictions into account; the paths returned collectively
                              form a spanning tree
                           </p>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </div>
         </div>
         <section class="section" id="_relationship_filter">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_relationship_filter"></a>12.1.1.&nbsp;Relationship Filter
                     </h3>
                  </div>
               </div>
            </div>
            <p>Syntax: <code class="literal">[&lt;]RELATIONSHIP_TYPE1[&gt;]|[&lt;]RELATIONSHIP_TYPE2[&gt;]|&#8230;&#8203;</code></p>
            <div class="informaltable">
               <div class="table" id="d0e14466">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">input</th>
                           <th style="text-align: left; vertical-align: top; ">type</th>
                           <th style="text-align: left; vertical-align: top; ">direction</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">LIKES&gt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">LIKES</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>OUTGOING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&lt;FOLLOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">FOLLOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>INCOMING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">KNOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">KNOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>BOTH</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&gt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">any type</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>OUTGOING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&lt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">any type</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>INCOMING</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_label_filter">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_label_filter"></a>12.1.2.&nbsp;Label Filter
                     </h3>
                  </div>
               </div>
            </div>
            <p>Syntax: <code class="literal">[+-/&gt;]LABEL1|LABEL2|*|&#8230;&#8203;</code></p>
            <div class="informaltable">
               <div class="table" id="d0e14547">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">input</th>
                           <th style="text-align: left; vertical-align: top; ">result</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">-Foe</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>blacklist filter - No node in the path will have a label in the blacklist.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">+Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>whitelist filter - All nodes in the path must have a label in the whitelist (exempting termination and end nodes, if using
                                 those filters).
                                 If no whitelist operator is present, all labels are considered whitelisted.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">/Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>termination filter - Only return paths up to a node of the given labels, and stop further expansion beyond it.
                                 Termination nodes do not have to respect the whitelist. Termination filtering takes precedence over end node filtering.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&gt;Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>end node filter - Only return paths up to a node of the given labels, but continue expansion to match on end nodes beyond
                                 it.
                                 End nodes do not have to respect the whitelist to be returned, but expansion beyond them is only allowed if the node has a
                                 label in the whitelist.
                              </p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <p><span class="formalpara-title">Syntax Changes.&nbsp;</span>As of APOC 3.1.3.x multiple label filter operations are allowed.
               In prior versions, only one type of operation is allowed in the label filter (<code class="literal">+</code> or <code class="literal">-</code> or <code class="literal">/</code> or <code class="literal">&gt;</code>, never more than one).
            </p>
            <p>With APOC 3.2.x.x, label filters will no longer apply to starting nodes of the expansion by default, but this can be toggled
               with the <code class="literal">filterStartNode</code> config parameter.
            </p>
            <p>With the APOC releases in January 2018, some behavior has changed in the label filters:</p>
            <div class="informaltable">
               <div class="table" id="d0e14614">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">filter</th>
                           <th style="text-align: left; vertical-align: top; ">changed behavior</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">No filter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Now indicates the label is whitelisted, same as if it were prefixed with <code class="literal">+</code>.
                                 Previously, a label without a filter symbol reused the previously used symbol.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal"><code class="literal">&gt;</code> (end node filter)</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>The label is additionally whitelisted, so expansion will always continue beyond an end node (unless prevented by the blacklist).
                                 Previously, expansion would only continue if allowed by the whitelist and not disallowed by the blacklist.
                                 This also applies at a depth below <code class="literal">minLevel</code>, allowing expansion to continue.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal"><code class="literal">/</code> (termination filter)</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>When at depth below <code class="literal">minLevel</code>, expansion is allowed to continue and no pruning will take place (unless prevented by the blacklist).
                                 Previously, expansion would only continue if allowed by the whitelist and not disallowed by the blacklist.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">All filters</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">*</code> is allowed as a standin for all labels.
                                 Additionally, compound labels are supported (like <code class="literal">Person:Manager</code>), and only apply to nodes with all of those labels present (order agnositic).
                              </p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_sequences">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_sequences"></a>12.1.3.&nbsp;Sequences
                     </h3>
                  </div>
               </div>
            </div>
            <p>Introduced in the February 2018 APOC releases, path expander procedures can expand on repeating sequences of labels, relationship
               types, or both.
            </p>
            <p>If only using label sequences, just use the <code class="literal">labelFilter</code>, but use commas to separate the filtering for each step in the repeating sequence.
            </p>
            <p>If only using relationship sequences, just use the <code class="literal">relationshipFilter</code>, but use commas to separate the filtering for each step of the repeating sequence.
            </p>
            <p>If using sequences of both relationships and labels, use the <code class="literal">sequence</code> parameter.
            </p>
            <div class="informaltable">
               <div class="table" id="d0e14695">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                        <col class="col_4"></col>
                        <col class="col_5"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">Usage</th>
                           <th style="text-align: left; vertical-align: top; ">config param</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                           <th style="text-align: left; vertical-align: top; ">syntax</th>
                           <th style="text-align: left; vertical-align: top; ">explanation</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>label sequences only</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">labelFilter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same syntax and filters, but uses commas (<code class="literal">,</code>) to separate the filters for each step in the sequence.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">labelFilter:'Post|-Blocked,Reply,&gt;Admin'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Start node must be a :Post node that isn&#8217;t :Blocked, next node must be a :Reply, and the next must be an :Admin, then repeat
                                 if able. Only paths ending with the <code class="literal">:Admin</code> node in that position of the sequence will be returned.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>relationship sequences only</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">relationshipFilter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same syntax, but uses commas (<code class="literal">,</code>) to separate the filters for each relationship traversal in the sequence.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">relationshipFilter:'NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Expansion will first expand <code class="literal">NEXT&gt;</code> from the start node, then <code class="literal">&lt;FROM</code>, then either <code class="literal">POSTED&gt;</code> or <code class="literal">REPLIED&gt;</code>, then repeat if able.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>sequences of both labels and relationships</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">sequence</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A string of comma-separated alternating label and relationship filters, for each step in a repeating sequence. The sequence
                                 should begin with a label filter, and end with a relationship filter. If present, <code class="literal">labelFilter</code>, and <code class="literal">relationshipFilter</code> are ignored, as this takes priority.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">sequence:'Post|-Blocked, NEXT&gt;, Reply, &lt;FROM, &gt;Admin, POSTED&gt;|REPLIED&gt;'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Combines the behaviors above.</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <section class="section" id="_starting_the_sequence_at_one_off_from_the_start_node">
               <div class="titlepage">
                  <div>
                     <div>
                        <h4 class="title"><a class="anchor" href="#_starting_the_sequence_at_one_off_from_the_start_node"></a>12.1.3.1.&nbsp;Starting the sequence at one-off from the start node
                        </h4>
                     </div>
                  </div>
               </div>
               <p>There are some uses cases where the sequence does not begin at the start node, but at one node distant.</p>
               <p>A new config parameter, <code class="literal">beginSequenceAtStart</code>, can toggle this behavior.
               </p>
               <p>Default value is <code class="literal">true</code>.
               </p>
               <p>If set to <code class="literal">false</code>, this changes the expected values for <code class="literal">labelFilter</code>, <code class="literal">relationshipFilter</code>, and <code class="literal">sequence</code> as noted below:
               </p>
               <div class="informaltable">
                  <div class="table" id="d0e14825">
                     <table class="informaltable" border="1">
                        <colgroup>
                           <col class="col_1"></col>
                           <col class="col_2"></col>
                           <col class="col_3"></col>
                           <col class="col_4"></col>
                        </colgroup>
                        <thead>
                           <tr>
                              <th style="text-align: left; vertical-align: top; ">sequence</th>
                              <th style="text-align: left; vertical-align: top; ">altered behavior</th>
                              <th style="text-align: left; vertical-align: top; ">example</th>
                              <th style="text-align: left; vertical-align: top; ">explanation</th>
                           </tr>
                        </thead>
                        <tbody>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">labelFilter</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The start node is not considered part of the sequence. The sequence begins one node off from the start node.</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, labelFilter:'Post|-Blocked,Reply,&gt;Admin'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The next node(s) out from the start node begins the sequence (and must be a :Post node that isn&#8217;t :Blocked), and only paths
                                    ending with <code class="literal">Admin</code> nodes returned.
                                 </p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">relationshipFilter</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The first relationship filter in the sequence string will not be considered part of the repeating sequence, and will only
                                    be used for the first relationship from the start node to the node that will be the actual start of the sequence.
                                 </p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, relationshipFilter:'FIRST&gt;,NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">FIRST&gt;</code> will be traversed just from the start node to the node that will be the start of the repeating <code class="literal">NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;</code> sequence.
                                 </p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">sequence</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>Combines the above two behaviors.</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, sequence:'FIRST&gt;, Post|-Blocked, NEXT&gt;, Reply, &lt;FROM, &gt;Admin, POSTED&gt;|REPLIED&gt;'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>Combines the behaviors above.</p>
                              </td>
                           </tr>
                        </tbody>
                     </table>
                  </div>
               </div>
               <p><span class="formalpara-title">Sequence tips.&nbsp;</span>Label filtering in sequences work together with the <code class="literal">endNodes</code>+<code class="literal">terminatorNodes</code>, though inclusion of a node must be unanimous.
               </p>
               <p>Remember that <code class="literal">filterStartNode</code> defaults to <code class="literal">false</code> for APOC 3.2.x.x and newer. If you want the start node filtered according to the first step in the sequence, you may need
                  to set this explicitly to <code class="literal">true</code>.
               </p>
               <p>If you need to limit the number of times a sequence repeats, this can be done with the <code class="literal">maxLevel</code> config param (multiply the number of iterations with the size of the nodes in the sequence).
               </p>
               <p>As paths are important when expanding sequences, we recommend avoiding <code class="literal">apoc.path.subgraphNodes()</code>, <code class="literal">apoc.path.subgraphAll()</code>, and <code class="literal">apoc.path.spanningTree()</code> when using sequences,
                  as the configurations that make these efficient at matching to distinct nodes may interfere with sequence pathfinding.
               </p>
            </section>
         </section>
         <section class="section" id="_uniqueness">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_uniqueness"></a>12.1.4.&nbsp;Uniqueness
                     </h3>
                  </div>
               </div>
            </div>
            <p>Uniqueness of nodes and relationships guides the expansion and the returned results.
               Uniqueness is only configurable using <code class="literal">expandConfig()</code>.
            </p>
            <p><code class="literal">subgraphNodes()</code>, <code class="literal">subgraphAll()</code>, and <code class="literal">spanningTree()</code> all use 'NODE_GLOBAL' uniqueness.
            </p>
            <div class="informaltable">
               <div class="table" id="d0e14951">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">value</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_PATH</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>For each returned node there&#8217;s a (relationship wise) unique path from the start node to it. This is Cypher&#8217;s default expansion
                                 mode.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_GLOBAL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A node cannot be traversed more than once. This is what the legacy traversal framework does.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_LEVEL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Entities on the same level are guaranteed to be unique.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_PATH</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>For each returned node there&#8217;s a unique path from the start node to it.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_RECENT</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>This is like NODE_GLOBAL, but only guarantees uniqueness among the most recent visited nodes, with a configurable count. Traversing
                                 a huge graph is quite memory intensive in that it keeps track of all the nodes it has visited.
                                 For huge graphs a traverser can hog all the memory in the JVM, causing OutOfMemoryError. Together with this Uniqueness you
                                 can supply a count, which is the number of most recent visited nodes. This can cause a node to be visited more than once,
                                 but scales infinitely.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_GLOBAL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A relationship cannot be traversed more than once, whereas nodes can.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_LEVEL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Entities on the same level are guaranteed to be unique.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_RECENT</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same as for NODE_RECENT, but for relationships.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NONE</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>No restriction (the user will have to manage it)</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_node_filters">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_node_filters"></a>12.1.5.&nbsp;Node Filters
                     </h3>
                  </div>
               </div>
            </div>
            <p>While label filters use labels to allow whitelisting, blacklisting, and restrictions on which kind of nodes can end or terminate
               expansion,
               you can also filter based upon actual nodes.
            </p>
            <p>Each of these config parameter accepts a list of nodes, or a list of node ids.</p>
            <div class="informaltable">
               <div class="table" id="d0e15041">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">config parameter</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                           <th style="text-align: left; vertical-align: top; ">added in</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">endNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes can end returned paths, and expansion will continue past these nodes, if possible.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Winter 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">terminatorNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes can end returned paths, and expansion won&#8217;t continue past these nodes.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Winter 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">whitelistNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes are allowed in the expansion (though endNodes and terminatorNodes will also be allowed, if present).</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Spring 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">blacklistNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>None of the paths returned will include these nodes.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Spring 2018 APOC releases.</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_expand_paths">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_expand_paths"></a>12.1.6.&nbsp;Expand paths
                     </h3>
                  </div>
               </div>
            </div>
            <p>Expand from start node following the given relationships from min to max-level adhering to the label filters. Several variations
               exist:
            </p>
            <p><code class="literal">apoc.path.expand()</code> expands paths using Cypher&#8217;s default expansion modes (bfs and 'RELATIONSHIP_PATH' uniqueness)
            </p>
            <p><code class="literal">apoc.path.expandConfig()</code> allows more flexible configuration of parameters and expansion modes
            </p>
            <p><code class="literal">apoc.path.subgraphNodes()</code> expands to nodes of a subgraph
            </p>
            <p><code class="literal">apoc.path.subgraphAll()</code> expands to nodes of a subgraph and also returns all relationships in the subgraph
            </p>
            <p><code class="literal">apoc.path.spanningTree()</code> expands to paths collectively forming a spanning tree
            </p>
         </section>
         <section class="section" id="_expand">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_expand"></a>12.1.7.&nbsp;Expand
                     </h3>
                  </div>
               </div>
            </div><pre class="programlisting highlight"><code data-lang="cypher">CALL apoc.path.expand(startNode &lt;id&gt;|Node, relationshipFilter, labelFilter, minLevel, maxLevel )

CALL apoc.path.expand(startNode &lt;id&gt;|Node|list, 'TYPE|TYPE_OUT&gt;|&lt;TYPE_IN', '+YesLabel|-NoLabel|/TerminationLabel|&gt;EndNodeLabel', minLevel, maxLevel ) yield path</code></pre></section>
         <section class="section" id="_relationship_filter_2">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_relationship_filter_2"></a>12.1.8.&nbsp;Relationship Filter
                     </h3>
                  </div>
               </div>
            </div>
            <p>Syntax: <code class="literal">[&lt;]RELATIONSHIP_TYPE1[&gt;]|[&lt;]RELATIONSHIP_TYPE2[&gt;]|&#8230;&#8203;</code></p>
            <div class="informaltable">
               <div class="table" id="d0e15136">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">input</th>
                           <th style="text-align: left; vertical-align: top; ">type</th>
                           <th style="text-align: left; vertical-align: top; ">direction</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">LIKES&gt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">LIKES</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>OUTGOING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&lt;FOLLOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">FOLLOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>INCOMING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">KNOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">KNOWS</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>BOTH</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&gt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">any type</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>OUTGOING</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&lt;</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">any type</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>INCOMING</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_label_filter_2">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_label_filter_2"></a>12.1.9.&nbsp;Label Filter
                     </h3>
                  </div>
               </div>
            </div>
            <p>Syntax: <code class="literal">[+-/&gt;]LABEL1|LABEL2|*|&#8230;&#8203;</code></p>
            <div class="informaltable">
               <div class="table" id="d0e15217">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">input</th>
                           <th style="text-align: left; vertical-align: top; ">result</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">-Foe</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>blacklist filter - No node in the path will have a label in the blacklist.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">+Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>whitelist filter - All nodes in the path must have a label in the whitelist (exempting termination and end nodes, if using
                                 those filters).
                                 If no whitelist operator is present, all labels are considered whitelisted.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">/Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>termination filter - Only return paths up to a node of the given labels, and stop further expansion beyond it.
                                 Termination nodes do not have to respect the whitelist. Termination filtering takes precedence over end node filtering.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">&gt;Friend</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>end node filter - Only return paths up to a node of the given labels, but continue expansion to match on end nodes beyond
                                 it.
                                 End nodes do not have to respect the whitelist to be returned, but expansion beyond them is only allowed if the node has a
                                 label in the whitelist.
                              </p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <p><span class="formalpara-title">Syntax Changes.&nbsp;</span>As of APOC 3.1.3.x multiple label filter operations are allowed.
               In prior versions, only one type of operation is allowed in the label filter (<code class="literal">+</code> or <code class="literal">-</code> or <code class="literal">/</code> or <code class="literal">&gt;</code>, never more than one).
            </p>
            <p>With APOC 3.2.x.x, label filters will no longer apply to starting nodes of the expansion by default, but this can be toggled
               with the <code class="literal">filterStartNode</code> config parameter.
            </p>
            <p>With the APOC releases in January 2018, some behavior has changed in the label filters:</p>
            <div class="informaltable">
               <div class="table" id="d0e15284">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">filter</th>
                           <th style="text-align: left; vertical-align: top; ">changed behavior</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">No filter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Now indicates the label is whitelisted, same as if it were prefixed with <code class="literal">+</code>.
                                 Previously, a label without a filter symbol reused the previously used symbol.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal"><code class="literal">&gt;</code> (end node filter)</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>The label is additionally whitelisted, so expansion will always continue beyond an end node (unless prevented by the blacklist).
                                 Previously, expansion would only continue if allowed by the whitelist and not disallowed by the blacklist.
                                 This also applies at a depth below <code class="literal">minLevel</code>, allowing expansion to continue.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal"><code class="literal">/</code> (termination filter)</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>When at depth below <code class="literal">minLevel</code>, expansion is allowed to continue and no pruning will take place (unless prevented by the blacklist).
                                 Previously, expansion would only continue if allowed by the whitelist and not disallowed by the blacklist.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">All filters</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">*</code> is allowed as a standin for all labels.
                                 Additionally, compound labels are supported (like <code class="literal">Person:Manager</code>), and only apply to nodes with all of those labels present (order agnositic).
                              </p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <p><span class="formalpara-title">Examples.&nbsp;</span>
               
            </p><pre class="programlisting highlight"><code data-lang="cypher">call apoc.path.expand(1,"ACTED_IN&gt;|PRODUCED&lt;|FOLLOWS&lt;","+Movie|Person",0,3)
call apoc.path.expand(1,"ACTED_IN&gt;|PRODUCED&lt;|FOLLOWS&lt;","-BigBrother",0,3)
call apoc.path.expand(1,"ACTED_IN&gt;|PRODUCED&lt;|FOLLOWS&lt;","",0,3)

// combined with cypher:

match (tom:Person {name :"Tom Hanks"})
call apoc.path.expand(tom,"ACTED_IN&gt;|PRODUCED&lt;|FOLLOWS&lt;","+Movie|Person",0,3) yield path as pp
return pp;

// or

match (p:Person) with p limit 3
call apoc.path.expand(p,"ACTED_IN&gt;|PRODUCED&lt;|FOLLOWS&lt;","+Movie|Person",1,2) yield path as pp
return p, pp</code></pre><p>
               
            </p>
            <p><span class="formalpara-title">Termination and end node label filter example.&nbsp;</span>We will first set a <code class="literal">:Western</code> label on some nodes.
            </p><pre class="programlisting highlight"><code data-lang="cypher">match (p:Person)
where p.name in ['Clint Eastwood', 'Gene Hackman']
set p:Western</code></pre><p>Now expand from 'Keanu Reeves' to all <code class="literal">:Western</code> nodes with a termination filter:
            </p><pre class="programlisting highlight"><code data-lang="cypher">match (k:Person {name:'Keanu Reeves'})
call apoc.path.expandConfig(k, {relationshipFilter:'ACTED_IN|PRODUCED|DIRECTED', labelFilter:'/Western', uniqueness: 'NODE_GLOBAL'}) yield path
return path</code></pre><p>The one returned path only matches up to 'Gene Hackman'.
               While there is a path from 'Keanu Reeves' to 'Clint Eastwood' through 'Gene Hackman', no further expansion is permitted through
               a node in the termination filter.
            </p>
            <p>If you didn&#8217;t want to stop expansion on reaching 'Gene Hackman', and wanted 'Clint Eastwood' returned as well, use the end
               node filter  instead (<code class="literal">&gt;</code>).
            </p>
            <p><span class="formalpara-title">Label filter operator precedence and behavior.&nbsp;</span>As of APOC 3.1.3.x, multiple label filter operators are allowed at the same time.
            </p>
            <p>When processing the labelFilter string, once a filter operator is introduced, it remains the active filter until another filter
               supplants it.
               (Not applicable after February 2018 release, as no filter will now mean the label is whitelisted).
            </p>
            <p>In the following example, <code class="literal">:Person</code> and <code class="literal">:Movie</code> labels are whitelisted, <code class="literal">:SciFi</code> is blacklisted, with <code class="literal">:Western</code> acting as an end node label, and <code class="literal">:Romance</code> acting as a termination label.
            </p>
            <p><code class="literal">&#8230;&#8203; labelFilter:'+Person|Movie|-SciFi|&gt;Western|/Romance' &#8230;&#8203;</code></p>
            <p>The precedence of operator evaluation isn&#8217;t dependent upon their location in the labelFilter but is fixed:</p>
            <p>Blacklist filter <code class="literal">-</code>, termination filter <code class="literal">/</code>, end node filter <code class="literal">&gt;</code>, whitelist filter <code class="literal">+</code>.
            </p>
            <p>The consequences are as follows:</p>
            <div class="itemizedlist">
               <ul class="itemizedlist" style="list-style-type: disc; ">
                  <li class="listitem">No blacklisted label <code class="literal">-</code> will ever be present in the nodes of paths returned, no matter if the same label (or another label of a node with a blacklisted
                     label) is included in another filter list.
                  </li>
                  <li class="listitem">If the termination filter <code class="literal">/</code> or end node filter <code class="literal">&gt;</code> is used, then only paths up to nodes with those labels will be returned as results. These end nodes are exempt from the whitelist
                     filter.
                  </li>
                  <li class="listitem">If a node is a termination node <code class="literal">/</code>, no further expansion beyond the node will occur.
                  </li>
                  <li class="listitem">If a node is an end node <code class="literal">&gt;</code>, expansion beyond that node will only occur if the end node has a label in the whitelist. This is to prevent returning paths
                     to nodes where a node on that path violates the whitelist.
                     (this no longer applies in releases after February 2018)
                  </li>
                  <li class="listitem">The whitelist only applies to nodes up to but not including end nodes from the termination or end node filters. If no end
                     node or termination node operators are present, then the whitelist applies to all nodes of the path.
                  </li>
                  <li class="listitem">If no whitelist operators are present in the labelFilter, this is treated as if all labels are whitelisted.</li>
                  <li class="listitem">If <code class="literal">filterStartNode</code> is false (which will be default in APOC 3.2.x.x), then the start node is exempt from the label filter.
                  </li>
               </ul>
            </div>
         </section>
         <section class="section" id="_sequences_2">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_sequences_2"></a>12.1.10.&nbsp;Sequences
                     </h3>
                  </div>
               </div>
            </div>
            <p>Introduced in the February 2018 APOC releases, path expander procedures can expand on repeating sequences of labels, relationship
               types, or both.
            </p>
            <p>If only using label sequences, just use the <code class="literal">labelFilter</code>, but use commas to separate the filtering for each step in the repeating sequence.
            </p>
            <p>If only using relationship sequences, just use the <code class="literal">relationshipFilter</code>, but use commas to separate the filtering for each step of the repeating sequence.
            </p>
            <p>If using sequences of both relationships and labels, use the <code class="literal">sequence</code> parameter.
            </p>
            <div class="informaltable">
               <div class="table" id="d0e15482">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                        <col class="col_4"></col>
                        <col class="col_5"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">Usage</th>
                           <th style="text-align: left; vertical-align: top; ">config param</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                           <th style="text-align: left; vertical-align: top; ">syntax</th>
                           <th style="text-align: left; vertical-align: top; ">explanation</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>label sequences only</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">labelFilter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same syntax and filters, but uses commas (<code class="literal">,</code>) to separate the filters for each step in the sequence.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">labelFilter:'Post|-Blocked,Reply,&gt;Admin'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Start node must be a :Post node that isn&#8217;t :Blocked, next node must be a :Reply, and the next must be an :Admin, then repeat
                                 if able. Only paths ending with the <code class="literal">:Admin</code> node in that position of the sequence will be returned.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>relationship sequences only</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">relationshipFilter</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same syntax, but uses commas (<code class="literal">,</code>) to separate the filters for each relationship traversal in the sequence.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">relationshipFilter:'NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Expansion will first expand <code class="literal">NEXT&gt;</code> from the start node, then <code class="literal">&lt;FROM</code>, then either <code class="literal">POSTED&gt;</code> or <code class="literal">REPLIED&gt;</code>, then repeat if able.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>sequences of both labels and relationships</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">sequence</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A string of comma-separated alternating label and relationship filters, for each step in a repeating sequence. The sequence
                                 should begin with a label filter, and end with a relationship filter. If present, <code class="literal">labelFilter</code>, and <code class="literal">relationshipFilter</code> are ignored, as this takes priority.
                              </p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">sequence:'Post|-Blocked, NEXT&gt;, Reply, &lt;FROM, &gt;Admin, POSTED&gt;|REPLIED&gt;'</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Combines the behaviors above.</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <section class="section" id="_starting_the_sequence_at_one_off_from_the_start_node_2">
               <div class="titlepage">
                  <div>
                     <div>
                        <h4 class="title"><a class="anchor" href="#_starting_the_sequence_at_one_off_from_the_start_node_2"></a>12.1.10.1.&nbsp;Starting the sequence at one-off from the start node
                        </h4>
                     </div>
                  </div>
               </div>
               <p>There are some uses cases where the sequence does not begin at the start node, but at one node distant.</p>
               <p>A new config parameter, <code class="literal">beginSequenceAtStart</code>, can toggle this behavior.
               </p>
               <p>Default value is <code class="literal">true</code>.
               </p>
               <p>If set to <code class="literal">false</code>, this changes the expected values for <code class="literal">labelFilter</code>, <code class="literal">relationshipFilter</code>, and <code class="literal">sequence</code> as noted below:
               </p>
               <div class="informaltable">
                  <div class="table" id="d0e15612">
                     <table class="informaltable" border="1">
                        <colgroup>
                           <col class="col_1"></col>
                           <col class="col_2"></col>
                           <col class="col_3"></col>
                           <col class="col_4"></col>
                        </colgroup>
                        <thead>
                           <tr>
                              <th style="text-align: left; vertical-align: top; ">sequence</th>
                              <th style="text-align: left; vertical-align: top; ">altered behavior</th>
                              <th style="text-align: left; vertical-align: top; ">example</th>
                              <th style="text-align: left; vertical-align: top; ">explanation</th>
                           </tr>
                        </thead>
                        <tbody>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">labelFilter</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The start node is not considered part of the sequence. The sequence begins one node off from the start node.</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, labelFilter:'Post|-Blocked,Reply,&gt;Admin'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The next node(s) out from the start node begins the sequence (and must be a :Post node that isn&#8217;t :Blocked), and only paths
                                    ending with <code class="literal">Admin</code> nodes returned.
                                 </p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">relationshipFilter</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>The first relationship filter in the sequence string will not be considered part of the repeating sequence, and will only
                                    be used for the first relationship from the start node to the node that will be the actual start of the sequence.
                                 </p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, relationshipFilter:'FIRST&gt;,NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">FIRST&gt;</code> will be traversed just from the start node to the node that will be the start of the repeating <code class="literal">NEXT&gt;,&lt;FROM,POSTED&gt;|REPLIED&gt;</code> sequence.
                                 </p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">sequence</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>Combines the above two behaviors.</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><code class="literal">beginSequenceAtStart:false, sequence:'FIRST&gt;, Post|-Blocked, NEXT&gt;, Reply, &lt;FROM, &gt;Admin, POSTED&gt;|REPLIED&gt;'</code></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>Combines the behaviors above.</p>
                              </td>
                           </tr>
                        </tbody>
                     </table>
                  </div>
               </div>
               <p><span class="formalpara-title">Sequence tips.&nbsp;</span>Label filtering in sequences work together with the <code class="literal">endNodes</code>+<code class="literal">terminatorNodes</code>, though inclusion of a node must be unanimous.
               </p>
               <p>Remember that <code class="literal">filterStartNode</code> defaults to <code class="literal">false</code> for APOC 3.2.x.x and newer. If you want the start node filtered according to the first step in the sequence, you may need
                  to set this explicitly to <code class="literal">true</code>.
               </p>
               <p>If you need to limit the number of times a sequence repeats, this can be done with the <code class="literal">maxLevel</code> config param (multiply the number of iterations with the size of the nodes in the sequence).
               </p>
               <p>As paths are important when expanding sequences, we recommend avoiding <code class="literal">apoc.path.subgraphNodes()</code>, <code class="literal">apoc.path.subgraphAll()</code>, and <code class="literal">apoc.path.spanningTree()</code> when using sequences,
                  as the configurations that make these efficient at matching to distinct nodes may interfere with sequence pathfinding.
               </p>
            </section>
         </section>
         <section class="section" id="_expand_with_config">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_expand_with_config"></a>12.1.11.&nbsp;Expand with Config
                     </h3>
                  </div>
               </div>
            </div><pre class="screen highlight"><code>apoc.path.expandConfig(startNode &lt;id&gt;Node/list, {config}) yield path expands from start nodes using the given configuration and yields the resulting paths</code></pre><p>Takes an additional map parameter, <code class="literal">config</code>, to provide configuration options:
            </p>
            <p><span class="formalpara-title">Config.&nbsp;</span>
               
            </p><pre class="screen highlight"><code>{minLevel: -1|number,
 maxLevel: -1|number,
 relationshipFilter: '[&lt;]RELATIONSHIP_TYPE1[&gt;]|[&lt;]RELATIONSHIP_TYPE2[&gt;], [&lt;]RELATIONSHIP_TYPE3[&gt;]|[&lt;]RELATIONSHIP_TYPE4[&gt;]',
 labelFilter: '[+-/&gt;]LABEL1|LABEL2|*,[+-/&gt;]LABEL1|LABEL2|*,...',
 uniqueness: RELATIONSHIP_PATH|NONE|NODE_GLOBAL|NODE_LEVEL|NODE_PATH|NODE_RECENT|
             RELATIONSHIP_GLOBAL|RELATIONSHIP_LEVEL|RELATIONSHIP_RECENT,
 bfs: true|false,
 filterStartNode: true|false,
 limit: -1|number,
 optional: true|false,
 endNodes: [nodes],
 terminatorNodes: [nodes],
 beginSequenceAtStart: true|false}</code></pre><p>
               
            </p>
         </section>
         <section class="section" id="_start_node_and_label_filters">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_start_node_and_label_filters"></a>12.1.12.&nbsp;Start Node and label filters
                     </h3>
                  </div>
               </div>
            </div>
            <p>The config parameter <code class="literal">filterStartNode</code> defines whether or not the labelFilter (and <code class="literal">sequence</code>) applies to the start node of the expansion.
            </p>
            <p>Use <code class="literal">filterStartNode: false</code> when you want your label filter to only apply to all other nodes in the path, ignoring the start node.
            </p>
            <p><code class="literal">filterStartNode</code> defaults for all path expander procedures:
            </p>
            <div class="informaltable">
               <div class="table" id="d0e15758">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">version</th>
                           <th style="text-align: left; vertical-align: top; ">default</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>&gt;= APOC 3.2.x.x</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>filterStartNode = false</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>&lt; APOC 3.2.x.x</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>filterStartNode = true</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_limit">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_limit"></a>12.1.13.&nbsp;Limit
                     </h3>
                  </div>
               </div>
            </div>
            <p>You can use the <code class="literal">limit</code> config parameter to limit the number of paths returned.
            </p>
            <p>When using <code class="literal">bfs:true</code> (which is the default for all expand procedures), this has the effect of returning paths to the <code class="literal">n</code> nearest nodes with labels in the termination or end node filter, where <code class="literal">n</code> is the limit given.
            </p>
            <p>The default limit value, <code class="literal">-1</code>, means no limit.
            </p>
            <p>If you want to make sure multiple paths should never match to the same node, use <code class="literal">expandConfig()</code> with 'NODE_GLOBAL' uniqueness, or any expand procedure which already uses this uniqueness
               (<code class="literal">subgraphNodes()</code>, <code class="literal">subgraphAll()</code>, and <code class="literal">spanningTree()</code>).
            </p>
         </section>
         <section class="section" id="_optional">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_optional"></a>12.1.14.&nbsp;Optional
                     </h3>
                  </div>
               </div>
            </div>
            <p>When <code class="literal">optional</code> is set to true, the path expansion is optional, much like an OPTIONAL MATCH, so a <code class="literal">null</code> value is yielded whenever the expansion would normally eliminate rows due to no results.
            </p>
            <p>By default <code class="literal">optional</code> is false for all expansion procedures taking a config parameter.
            </p>
            <p><span class="formalpara-title">Uniqueness.&nbsp;</span>Uniqueness of nodes and relationships guides the expansion and the results returned.
               Uniqueness is only configurable using <code class="literal">expandConfig()</code>.
            </p>
            <p><code class="literal">subgraphNodes()</code>, <code class="literal">subgraphAll()</code>, and <code class="literal">spanningTree()</code> all use 'NODE_GLOBAL' uniqueness.
            </p>
            <div class="informaltable">
               <div class="table" id="d0e15855">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">value</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_PATH</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>For each returned node there&#8217;s a (relationship wise) unique path from the start node to it. This is Cypher&#8217;s default expansion
                                 mode.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_GLOBAL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A node cannot be traversed more than once. This is what the legacy traversal framework does.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_LEVEL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Entities on the same level are guaranteed to be unique.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_PATH</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>For each returned node there&#8217;s a unique path from the start node to it.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NODE_RECENT</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>This is like NODE_GLOBAL, but only guarantees uniqueness among the most recent visited nodes, with a configurable count. Traversing
                                 a huge graph is quite memory intensive in that it keeps track of all the nodes it has visited.
                                 For huge graphs a traverser can hog all the memory in the JVM, causing OutOfMemoryError. Together with this Uniqueness you
                                 can supply a count, which is the number of most recent visited nodes. This can cause a node to be visited more than once,
                                 but scales infinitely.
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_GLOBAL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>A relationship cannot be traversed more than once, whereas nodes can.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_LEVEL</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Entities on the same level are guaranteed to be unique.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">RELATIONSHIP_RECENT</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Same as for NODE_RECENT, but for relationships.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">NONE</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>No restriction (the user will have to manage it)</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_node_filters_2">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_node_filters_2"></a>12.1.15.&nbsp;Node filters
                     </h3>
                  </div>
               </div>
            </div>
            <p>While label filters use labels to allow whitelisting, blacklisting, and restrictions on which kind of nodes can end or terminate
               expansion,
               you can also filter based upon actual nodes.
            </p>
            <p>Each of these config parameter accepts a list of nodes, or a list of node ids.</p>
            <div class="informaltable">
               <div class="table" id="d0e15945">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                        <col class="col_3"></col>
                     </colgroup>
                     <thead>
                        <tr>
                           <th style="text-align: left; vertical-align: top; ">config parameter</th>
                           <th style="text-align: left; vertical-align: top; ">description</th>
                           <th style="text-align: left; vertical-align: top; ">added in</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">endNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes can end returned paths, and expansion will continue past these nodes, if possible.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Winter 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">terminatorNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes can end returned paths, and expansion won&#8217;t continue past these nodes.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Winter 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">whitelistNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Only these nodes are allowed in the expansion (though endNodes and terminatorNodes will also be allowed, if present).</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Spring 2018 APOC releases.</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">blacklistNodes</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>None of the paths returned will include these nodes.</p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>Spring 2018 APOC releases.</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
         </section>
         <section class="section" id="_general_examples">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_general_examples"></a>12.1.16.&nbsp;General Examples
                     </h3>
                  </div>
               </div>
            </div>
            <p>You can turn this cypher query:</p><pre class="programlisting highlight"><code data-lang="cypher">MATCH (user:User) WHERE user.id = 460
MATCH (user)-[:RATED]-&gt;(movie)&lt;-[:RATED]-(collab)-[:RATED]-&gt;(reco)
RETURN count(*);</code></pre><p>into this procedure call, with changed semantics for uniqueness and bfs (which is Cypher&#8217;s expand mode)</p><pre class="programlisting highlight"><code data-lang="cypher">MATCH (user:User) WHERE user.id = 460
CALL apoc.path.expandConfig(user,{relationshipFilter:"RATED",minLevel:3,maxLevel:3,bfs:false,uniqueness:"NONE"}) YIELD path
RETURN count(*);</code></pre></section>
         <section class="section" id="_expand_to_nodes_in_a_subgraph">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_expand_to_nodes_in_a_subgraph"></a>12.1.17.&nbsp;Expand to nodes in a subgraph
                     </h3>
                  </div>
               </div>
            </div><pre class="screen highlight"><code>apoc.path.subgraphNodes(startNode &lt;id&gt;Node/list, {maxLevel, relationshipFilter, labelFilter, bfs:true, filterStartNode:true, limit:-1, optional:false}) yield node</code></pre><p>Expand to subgraph nodes reachable from the start node following relationships to max-level adhering to the label filters.</p>
            <p>Accepts the same <code class="literal">config</code> values as in <code class="literal">expandConfig()</code>, though <code class="literal">uniqueness</code> and <code class="literal">minLevel</code> are not configurable.
            </p>
            <p><span class="formalpara-title">Examples.&nbsp;</span>Expand to all nodes of a connected subgraph:
            </p><pre class="programlisting highlight"><code data-lang="cypher">MATCH (user:User) WHERE user.id = 460
CALL apoc.path.subgraphNodes(user, {}) YIELD node
RETURN node;</code></pre><p>Expand to all nodes reachable by :FRIEND relationships:</p><pre class="programlisting highlight"><code data-lang="cypher">MATCH (user:User) WHERE user.id = 460
CALL apoc.path.subgraphNodes(user, {relationshipFilter:'FRIEND'}) YIELD node
RETURN node;</code></pre></section>
      </section>
      <footer><script type="text/javascript">
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          //Allow Linker
          ga('create', 'UA-1192232-34','auto', {'allowLinker': true});
          ga('send', 'pageview');
          // Load the plugin.
          ga('require', 'linker');
          // Define which domains to autoLink.
          ga('linker:autoLink', ['neo4j.org','neo4j.com','neotechnology.com','graphdatabases.com','graphconnect.com']);
        </script><script type="text/javascript">
          document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
        </script><script>Munchkin.init('773-GON-065');</script></footer>
   </body>
</html>